package com.example.jixeishi1.cnofig;


import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/*
配置类
    跨域
    拦截器
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {



//    跨域
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("*")
                .allowedOriginPatterns("*")
//                .allowCredentials(true)
                .maxAge(3600)
                .allowedHeaders("*");
    }






}
